/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package grupb.upf.gui;

import java.io.File;
import javax.swing.filechooser.FileSystemView;

/**
 *
 * @author usuario
 */
public final class FileChooser extends FileSystemView {

    private File root;
    private File[] roots = new File[1];

    public FileChooser(final File root) {
        super();
        this.root = root;
        roots[0] = root;
    }

    @Override
    public File createNewFolder(final File containingDir) {
        final File folder = new File(containingDir, "New Folder");
        folder.mkdir();
        return folder;
    }

    @Override
    public File getDefaultDirectory() {
        return root;
    }

    @Override
    public File getHomeDirectory() {
        return root;
    }

    @Override
    public File[] getRoots() {
        return roots;
    }
}
